<?php 
 $pageTitle = '我的订单';
 $pageId="page-order-list";
?>

@extends('ios.pageIndex')

@section('page-content')
<div class="content-padded m-order-list">
	<table>
		<thead>
			<th>时间</th>
			<th>订单号</th>
			<th>金额</th>
			<th>状态</th>
			<th>操作</th>
		</thead>
		<tbody>
			@foreach($orders as $order)
			<tr>
				<td>{{date('y-m-d',strtotime($order->created_at))}}</td>
				<td>{{$order->id}}</td>
				<td>¥{{$order->product_total_price + $order->freight}}</td>
				<td>
				@if($order->status == 0)
	            	未支付
	            @elseif ($order->status == 1)
	            	已支付
	            @elseif ($order->status == 2)
	            	已发货
	            @elseif ($order->status == 3)
	            	已退货
	            @else
	            	已关闭
	            @endif
				</td>
				<td>
					@if($order->status == 0)
		            <a href="{{URL::to('order/pay',$order->id)}}" class="external">支付</a>
		            @else
		            <a href="{{URL::to('user/order',$order->id)}}" class="external">详情</a>
		            @endif
				</td>
			</tr>
			@endforeach
		</tbody>
	</table>
</div>
@stop